package Lab6;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: boo
 * Date: 19.11.13
 * Time: 14:38
 * To change this template use File | Settings | File Templates.
 */
class ModelGraph {


        String a="";
        ArrayList<Object> edgeList = new ArrayList<Object>();
        Map <Integer,String> colorVertex = new HashMap<Integer, String>();
        int vertexNum, edgeNum;

   public void boo(){
        try {
             BufferedReader readFile = new BufferedReader ( new FileReader("BBPE.txt"));
             try{
                a = readFile.readLine();
                //System.out.println(a);
                 vertexNum = Integer.parseInt(a.substring(0,a.indexOf(" ")));
                  edgeNum = Integer.parseInt(a.substring(a.indexOf(" ")+1)) ;
                // System.out.println("Number of vertexNum=" + vertexNum+" Number of edgeNum= " + edgeNum);

                 int[] edge = new int[2];
                 for (int i=0;i<edgeNum;i++){
                        a=readFile.readLine();
                        edge[0]=Integer.parseInt(a.substring(0,a.indexOf(" ")));
                        edge[1]=Integer.parseInt(a.substring(a.indexOf(" ")+1));
                        edgeList.add(edge);
                 }
                 for (int i=0;i<vertexNum;i++){
                     a=readFile.readLine();
                     colorVertex.put(Integer.parseInt(a.substring(0,a.indexOf(" "))),a.substring(a.indexOf(" ")+1));
                 }
                 //System.out.println(colorVertex);
             } catch (EOFException e1){System.out.println(e1);}
        }catch (IOException e2){System.out.println(e2);}
   }
int getVertexNum(){
    return(vertexNum);
}
       /*======================================================================================================*/

 }

